package com.abel.bigwater.wflow.mapper

import com.abel.bigmeter.service.MeterParam
import org.junit.Assert.*
import org.junit.FixMethodOrder
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.MethodSorters
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner

@SpringBootTest
@RunWith(SpringRunner::class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
class MeterMapperTest {
    @Autowired
    var meterMapper: MeterMapper? = null

    /**
     * 列举水司的全部水表档案。
     */
    @Test
    fun test11MeterList() {
        val mlist = meterMapper!!.selectMeter(MeterParam().apply { firmId = "23" })
        lgr.info("meter count for firm 23: ${mlist.size}")
        assertTrue("more than 1 meter", mlist.isNotEmpty())
    }

    companion object {
        private val lgr = LoggerFactory.getLogger(MeterMapperTest::class.java)
    }
}